From: Dan Winship Date: Wed, 13 Jul 2011 19:07:39 +0000 (-0400) Subject: screenSaver: bugfixes X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~8049 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=5f86e29830e5921069679074f7cff65143b1f676;p=gnome-shell.git screenSaver: bugfixes Fix the signal handling; you can't use this.connect('ActiveChanged') to connect to a D-Bus signal after replacing the signal methods with the lang.signals versions. Just leave it using the D-Bus signal names, just like it uses the D-Bus method names. Also, remove the "_" from "_screenSaverActive", to match what AutomountManager checks for, and remove getActive(), since it's not needed. https://bugzilla.gnome.org/show_bug.cgi?id=654550 --- diff --git a/js/misc/screenSaver.js b/js/misc/screenSaver.js index da592f6c8..f9d6af867 100644 --- a/js/misc/screenSaver.js +++ b/js/misc/screenSaver.js @@ -2,7 +2,6 @@ const DBus = imports.dbus; const Lang = imports.lang; -const Signals = imports.signals; const ScreenSaverIface = { name: 'org.gnome.ScreenSaver', @@ -32,28 +31,23 @@ ScreenSaverProxy.prototype = { Lang.bind(this, this._onSSAppeared), Lang.bind(this, this._onSSVanished)); + this.screenSaverActive = false; this.connect('ActiveChanged', Lang.bind(this, this._onActiveChanged)); }, _onSSAppeared: function(owner) { this.GetActiveRemote(Lang.bind(this, function(isActive) { - this._screenSaverActive = isActive; + this.screenSaverActive = isActive; })) }, _onSSVanished: function(oldOwner) { - this._screenSaverActive = false; + this.screenSaverActive = false; }, _onActiveChanged: function(object, isActive) { - this._screenSaverActive = isActive; - this.emit('active-changed', this._screenSaverActive); - }, - - getActive: function() { - return this._screenSaverActive; + this.screenSaverActive = isActive; } }; DBus.proxifyPrototype(ScreenSaverProxy.prototype, ScreenSaverIface); -Signals.addSignalMethods(ScreenSaverProxy.prototype); diff --git a/js/ui/automountManager.js b/js/ui/automountManager.js index 7afb5515a..93b093ab2 100644 --- a/js/ui/automountManager.js +++ b/js/ui/automountManager.js @@ -86,7 +86,7 @@ AutomountManager.prototype = { this.ckListener = new ConsoleKitManager(); this._ssProxy = new ScreenSaver.ScreenSaverProxy(); - this._ssProxy.connect('active-changed', + this._ssProxy.connect('ActiveChanged', Lang.bind(this, this._screenSaverActiveChanged)); @@ -201,7 +201,7 @@ AutomountManager.prototype = { if (!this.ckListener.sessionActive) return; - if (this._ssProxy.getActive()) { + if (this._ssProxy.screenSaverActive) { if (this._volumeQueue.indexOf(volume) == -1) this._volumeQueue.push(volume);